package com.uphone.kingmall.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.china.zhuoyue.R;
import com.uphone.kingmall.bean.IndexCatsList;
import com.uphone.kingmall.utils.GlideUtils;

/**
 * author : SuMeng
 * e-mail : 986335838@qq.com
 * time   : 2019/02/16
 * desc   : xxxx 描述
 */
public class ClassFenLeiAdapter extends BaseQuickAdapter<IndexCatsList.CatsBean, BaseViewHolder> {

    public ClassFenLeiAdapter() {
        super(R.layout.kingmall_item_home_class);
    }

    @Override
    protected void convert(final BaseViewHolder helper, final IndexCatsList.CatsBean item) {
        helper.setText(R.id.tv_class_name, item.getCatName());
        ImageView iv_lawyer_icon = helper.getView(R.id.iv_class);
        if (helper.getLayoutPosition() == getData().size() - 1) {
            GlideUtils.getInstance().loadCircleImage(mContext, R.mipmap.icon_more_cricle, iv_lawyer_icon);
        } else {
            GlideUtils.getInstance().loadCircleImage(mContext, item.getCatIcon(), iv_lawyer_icon);
        }
    }
}